package com.demo.listener;

import com.itdl.mq.business.KeyExpireBusinessHandle;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Component;

/**
 * 测试key过期监听
 */
@Component
@Slf4j
public class TestKeyListener12 implements KeyExpireBusinessHandle {
    @Override
    public void handle(String expireKey) {
        log.info("{}处理过期key【{}】",this.getClass().getSimpleName(), expireKey);
    }

    @Override
    public Boolean matchKey(String expireKey) {
        return expireKey.startsWith("test:");
    }
}
